﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using WebApplication1.DAO.Helper;

namespace  WebApplication1.DAO
{
    public class echartsdb
    {
        /// <summary>
        /// 获取功率
        /// </summary>
        /// <returns></returns>
        public List<string> GetWInfo()
        {
            string sql = "select visValue from visualization where visName = '功率'";
            SqlDataReader objReader = SQLHelper.GetReader(sql);
            List<string> wInfo = new List<string>();
            while (objReader.Read())
            {
                wInfo.Add(objReader["visValue"].ToString());
            }
            objReader.Close();
            return wInfo;
        }
        /// <summary>
        /// 获取电压
        /// </summary>
        /// <returns></returns>
        public List<string> GetVInfo()
        {
            string sql = "select visValue from visualization where visName = '电压'";
            SqlDataReader objReader = SQLHelper.GetReader(sql);
            List<string> vInfo = new List<string>();
            while (objReader.Read())
            {
                vInfo.Add(objReader["visValue"].ToString());
            }
            objReader.Close();
            return vInfo;
        }
        /// <summary>
        /// 获取电流
        /// </summary>
        /// <returns></returns>
        public List<string> GetAInfo()
        {
            string sql = "select visValue from visualization where visName = '电流'";
            SqlDataReader objReader = SQLHelper.GetReader(sql);
            List<string> aInfo = new List<string>();
            while (objReader.Read())
            {
                aInfo.Add(objReader["visValue"].ToString());
            }
            objReader.Close();
            return aInfo;
        }
    }
}